package fr.teuteuf.runstickmanrun.map.block;

import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.physics.box2d.World;

import fr.teuteuf.runstickmanrun.map.MapGenerator;
import fr.teuteuf.runstickmanrun.map.tile.SolidBoxTile;
import fr.teuteuf.runstickmanrun.map.tile.Tile;

public class BasicBlock extends AbstractMapBlock {
	
	public BasicBlock() {
		setDifficulties(0, 0, 0);
		setCurrentLevel(0);
	}

	@Override
	public int generateBlock(World world, MapGenerator mg, int nbHorizontalTiles) {
		int blockLength = MathUtils.random(10, 25);
		
		for(int i = 0; i < blockLength; i++) {
			mg.addTile(new SolidBoxTile((byte) 1, 1, 1, (nbHorizontalTiles + i) * Tile.TILE_SIZE, 0 * Tile.TILE_SIZE, world));
		}
		
		return nbHorizontalTiles + blockLength;
	}
}
